<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
    <!-- 新 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/main.css">
    <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
    <script src="js/jquery.min.js"></script>
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="js/bootstrap.min.js"></script>
    <script src="js/style.js"></script>
    <title>團購券核銷</title>
</head>
<script type="text/javascript">
 function show(){
     parent.document.getElementById("myModal").style.display="block";
 }
 function show1(){
     parent.document.getElementById("myModal1").style.display="block";
 }

</script>
<body>
<div class="hx-main" style="position: relative;">
    <div class="main-title">
        團購券核銷
    </div>
    <div class="select-shop">
        <h4>驗券分店</h4>
        <p>
            <span style="color: #6c6767;">澳門-鉅記餅家(百老匯店)</span></br>
             <span><a href="" style="color: #00a189;text-decoration: none;" data-toggle="modal" data-target="#myModal" onclick="show1()">修改分店</a></span>
        </p>
    </div>
    <div class="hx-content">
        <form action="" method="post">
            <div class="form-group" style="margin-right: 10px;">
                <label class="sr-only">名称</label>
                <input type="text" style="height: 50px;width: 280px;text-align: center" class="form-control code" maxlength="9" id="code" name="code" id="" oninput="aa()" onblur="this.placeholder='請輸入8位團購券號碼'" onfocus="this.placeholder=''" placeholder="請輸入8位團購券號碼">
            </div>
            <button type="button" class="btn btn-lg hx-search" disabled id="yzBtn" style="color: #ffffff;outline: none" data-toggle="modal" data-target="#myModal"onclick="show()">查询</button>
        </form>
    </div>
</div>

<script>
    $(function() {
        $('#code').bind('input', function() {
            var val = $(this).val().replace(/\s/g, '');
            if (!$.isNumeric(val)) {//判断输入是否为数字或者数字字符串
                $(this).val('');
            } else {
                if (val.length > 4) {
                    $(this).val(val.slice(0, 4) + ' ' + val.slice(4));
                }
                if (val.length == 8) {
                    $('#yzBtn').removeAttr('disabled');
                    $(this).blur();
                    search();
                } else {
                    $('#yzBtn').attr('disabled', 'disabled');
                }
            }
        });
    });
</script>
</body>
</html>